<?php

class Zend_View_Helper_CheckUser extends Zend_View_Helper_Abstract
{

	protected $_id;
	
	public function __construct()
	{
		$auth = Zend_Auth::getInstance();
		if ( $auth->hasIdentity() )
		{
			$users = new Application_Model_Users();
			$this->_id = $users->getCurrentUser()->id;
		}
	}
	
	public function checkUser( )
	{
		$auth = Zend_Auth::getInstance();
		if ( $auth->hasIdentity() )
		{
			$users = new Application_Model_Users();
			$user = $users->getOneUser( $this->_id );
			if ( $user['Approved'] == 1 || $user['Bann'] == 0) 
			{
				return false;
			}else
			{
				return true;
			}
		}	 
	}
}


